package testesinterfacegrafica;

import interfaceusuario.ColorRendererTabelaResultadosDosTestes;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;


public class TestePintarCelulasDeUmaJTable 
{
	public static void main(String args[])
	{
		JFrame f = new JFrame();
		JPanel p = new JPanel();
		
		
		Object[][] data = {};
		DefaultTableModel model = new DefaultTableModel();
		JTable table = new JTable(model);
		JTableHeader header = table.getTableHeader();
		model.addColumn("resultado esperado");
		model.addColumn("resultado obtido");
		header.setBackground(Color.yellow);
		//model.addRow(new Object[]{"andrews", "rocha"});
		//model.addRow(new Object[]{"paaa", "rocha"});
		model.addRow(new Object[]{1, 0});
		model.addRow(new Object[]{0, 0});
		
		table.getColumnModel().getColumn(1).setCellRenderer(new ColorRendererTabelaResultadosDosTestes());
		table.getColumnModel().getColumn(0).setCellRenderer(new ColorRendererTabelaResultadosDosTestes());
		p.add(header);
		p.add(table);
		f.add(p);
		
		f.setVisible(true);
		f.pack();
	}
}
